package com.nervenets.general.enumeration;

import io.swagger.annotations.ApiModel;

@ApiModel("操作类型")
public enum Action implements Enums {
    add("新增"),
    update("更新"),
    delete("删除");

    private final String text;

    Action(String text) {
        this.text = text;
    }

    @Override
    public String getText() {
        return text;
    }

    @Override
    public String getValue() {
        return this.name();
    }

    public boolean isAdd() {
        return add.equals(this);
    }

    public boolean isUpdate() {
        return update.equals(this);
    }

    public boolean isAddOrUpdate() {
        return add.equals(this) || update.equals(this);
    }

    public boolean isAddOrDelete() {
        return add.equals(this) || delete.equals(this);
    }

    public boolean isDelete() {
        return delete.equals(this);
    }
}
